<?php
	echo $this->Html->css('custom');
?>

<?php
	//echo 'passed:' . $srch;
    //echo '<br>';
//    echo 'convert back from passed: ' . date('F Y', $rng);
//    echo '<br>';
//$str = strtotime($rng);
////    
//echo '<br>this range :'  .$str;
//$dt = date('Y-m', $str);
//echo '<br>passed to dt' . $dt;
  // echo pr($hbyusr);?>
   
   <?php
   
   foreach($hbyusr as $usr)
   {
    echo '<table class="hreport">';
    $i = 0;
    //echo '<th>';
    echo '<p class="hreport-p">User: ' . $usr['User']['fname'] . ' ' . $usr['User']['lname'] . ' (<a href="mailto:' . $usr['User']['email_address'] . '">' .$usr['User']['email_address']. '</a>)</p>';
    //echo '</th>';
    echo '<th style="text-align:left">Task Title</th><th>Task Date</th><th>Hours</th>';
        foreach($usr['Job'] as $j)
        {   
            if($range == date('Y-m', strtotime($j['sdate'])))
            {
                echo '<tr>';
                echo '<td>' . $j['title'] . '</td>';
                echo '<td>' . $j['sdate'] . '</td>';
                echo '<td style="text-align:center">' . $j['volhours'] . '</td>';
                echo '</tr>';
                $i = $i + $j['volhours'];
            }
            
        }
        echo '</table>';
        echo '<br>';
        echo 'Total Hours volunteer by ' . $usr['User']['fname'] . ' ' . $usr['User']['lname'] . ' this month: ' .$i;
        echo '<hr>';
   }
  // echo '<br>-------------break----------------';
//   echo pr($sumhours) 
?>
